home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: Unbuffered character input...
- Date: 30 Jan 1996 07:33:09 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4eldnlINNc9f@keats.ugrad.cs.ubc.ca>
- References: <Pine.SGI.3.91.960129190205.27936A-100000@tahiti.cs.unm.edu>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <Pine.SGI.3.91.960129190205.27936A-100000@tahiti.cs.unm.edu>,
- Caleb Haley <chaley@tahiti.cs.unm.edu> wrote:
- >Greetings!
- >
- >Just curious--is there a way to do unbuffered character input in c?
- >i.e. getting just one character without waiting for a carriage return
- >(enter)...
-
- No. You set this up with OS-specific system calls. The C language has no
- built-in input or output methods. The standard C library is not powerful enough
- to take advantage of all the various OS features that are out there.
-
- >Any help is appreciated :)
- >
- >----==-- CHaley: chaley@possibility.zynet.com, chaley@cs.unm.edu
- >---==--- HOME:+1.505.292.4246
- >--==---- Possibility Systems:custom system design(http://www.zynet.com/~possys
- >-======- Proud Linux system administrator. The choice of a GNU generation.
-
- If you are using Linux, learn about controlling terminal characteristics with
- the POSIX termio functions. The Advanced Programming in the UNIX Environment
- text discusses this in detail, I believe.
-
- You can put the terminal driver in a mode such that it delivers individual
- characters to a read() request, instead of processing lines. Or you can use
- curses, which cushions you from having to talk to the terminal device driver
- directly.
-
- If you use X, you simply process keypress and keyrelease events coming from the
- X display server, which gives you a lot more flexibility.
- --
-
-